package a.j;

import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

public class v
  extends u
  implements md.m_
{
  private final Collection e = new ArrayList();
  private final Collection f = Collections.unmodifiableCollection(this.e);
  private final c_ g = new c_(null);
  private ld h;
  private pg i;
  private d_ j;
  public static boolean k;
  
  public void a(d_ paramd_)
  {
    if (paramd_ != null) {
      this.e.add(paramd_);
    }
  }
  
  public void b(d_ paramd_)
  {
    if (paramd_ != null) {
      this.e.remove(paramd_);
    }
  }
  
  public Collection g()
  {
    return this.f;
  }
  
  public dd a(ld paramld, pg parampg, double paramDouble1, double paramDouble2, sc paramsc)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (e())
      {
        this.i = parampg;
        this.h = paramld;
        if (!bool)
        {
          if (a(paramDouble1, paramDouble2) != null) {
            return this;
          }
          this.i = null;
        }
        this.h = null;
        return null;
      }
      this.i = null;
    }
    this.h = null;
    return null;
  }
  
  public boolean a(ng paramng)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    double d1 = paramng.a();
    double d2 = paramng.b();
    Iterator localIterator = this.e.iterator();
    while (localIterator.hasNext())
    {
      d_ locald_ = (d_)localIterator.next();
      locald_.a(this.i, this, this.h);
      if (locald_.a(d1, d2))
      {
        boolean bool1 = locald_.a(paramng);
        if ((bool3) || (bool2)) {
          break label111;
        }
        if (bool1) {
          return true;
        }
      }
    }
    label111:
    return false;
  }
  
  public void d()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.j != null)
      {
        if (!bool2) {
          if (this.j.b()) {
            this.j.d();
          }
        }
        this.j = null;
      }
    }
    if (!bool2)
    {
      if (this.i != null)
      {
        this.i.a(Cursor.getDefaultCursor());
        this.i = null;
      }
      this.h = null;
    }
    Iterator localIterator = this.e.iterator();
    if (localIterator.hasNext()) {}
    while (bool2)
    {
      ((d_)localIterator.next()).a(null, null, null);
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
    }
    super.d();
  }
  
  public void b(ng paramng)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.j == null)
      {
        double d1 = paramng.a();
        double d2 = paramng.b();
        int m = 0;
        Cursor localCursor = null;
        Iterator localIterator = this.e.iterator();
        do
        {
          d_ locald_;
          do
          {
            do
            {
              if (!localIterator.hasNext()) {
                break;
              }
              locald_ = (d_)localIterator.next();
              locald_.a(this.i, this, this.h);
              if (!bool2) {
                if (locald_.a(paramng))
                {
                  this.j = locald_;
                  this.j.a(this.g);
                  this.j.c();
                  if (bool2) {
                    break label207;
                  }
                  this.j.b(paramng);
                  if (!bool1) {
                    break;
                  }
                }
              }
            } while (!locald_.a(d1, d2));
            m = 1;
            if ((bool2) || (bool1)) {
              break label234;
            }
          } while (localCursor != null);
          if (bool2) {
            break label207;
          }
          localCursor = locald_.c(paramng);
        } while (!bool1);
        if (this.j != null) {
          label207:
          return;
        }
        if (!bool2)
        {
          if (m != 0)
          {
            if (bool2) {
              break label277;
            }
            if (this.i != null)
            {
              if (localCursor != null)
              {
                label234:
                this.i.a(localCursor);
                if (!bool2) {
                  if (!bool1) {
                    return;
                  }
                }
              }
              else
              {
                this.i.a(Cursor.getDefaultCursor());
              }
              if (bool2) {
                break label287;
              }
              if (!bool1) {
                return;
              }
            }
          }
          label277:
          if (bool2) {
            break label291;
          }
          d();
        }
        if (!bool1) {
          label287:
          return;
        }
      }
    }
    label291:
    this.j.b(paramng);
  }
  
  private d_ a(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if ((bool) || (!this.e.isEmpty()))
    {
      Iterator localIterator = this.e.iterator();
      while (localIterator.hasNext())
      {
        d_ locald_ = (d_)localIterator.next();
        locald_.a(this.i, this, this.h);
        if (locald_.a(paramDouble1, paramDouble2)) {
          return locald_;
        }
      }
    }
    return null;
  }
  
  public static class a_
    extends u
    implements v.d_
  {
    WeakReference e = new WeakReference(null);
    WeakReference f = new WeakReference(null);
    public static boolean g;
    
    protected boolean d(ng paramng)
    {
      boolean bool = ld.E;
      if (!bool)
      {
        if (paramng.c() == 500)
        {
          if (bool) {
            break label45;
          }
          if (paramng.f() != 1) {
            break label44;
          }
        }
        if (bool) {
          break label45;
        }
      }
      label44:
      label45:
      return paramng.c() == 506;
    }
    
    public boolean a(ng paramng)
    {
      return d(paramng);
    }
    
    public void b(ng paramng)
    {
      d();
      if ((ld.E) || (d(paramng))) {
        e(paramng);
      }
    }
    
    public void a(pg parampg, v paramv, ld paramld)
    {
      this.e = new WeakReference(parampg);
      this.f = new WeakReference(paramv);
    }
    
    public boolean a(double paramDouble1, double paramDouble2)
    {
      return false;
    }
    
    public Cursor c(ng paramng)
    {
      return null;
    }
    
    protected void e(ng paramng)
    {
      boolean bool = ld.E;
      pg localpg = (pg)this.e.get();
      v localv = (v)this.f.get();
      if (localpg != null)
      {
        if (bool) {
          break label45;
        }
        if (localv != null) {}
      }
      else
      {
        return;
      }
      label45:
      Object localObject1 = paramng.i();
      if ((bool) || ((localObject1 instanceof uf)))
      {
        uf localuf = (uf)localObject1;
        qf localqf = null;
        for (Object localObject2 = localuf.h(); localObject2 != null; localObject2 = ((gf)localObject2).h()) {
          if (!bool) {
            if (((gf)localObject2).c())
            {
              if (bool) {
                continue;
              }
              if ((localObject2 instanceof qf))
              {
                localqf = (qf)localObject2;
                break;
              }
            }
          }
        }
        if (!bool) {
          if (localqf == null)
          {
            localObject2 = localpg.s();
            while (((Iterator)localObject2).hasNext())
            {
              gf localgf = (gf)((Iterator)localObject2).next();
              if ((localgf.c()) && ((bool) || ((localgf instanceof qf)))) {
                localqf = (qf)localgf;
              }
            }
          }
        }
        if (localqf != null)
        {
          localv.a(false);
          localv.d();
          try
          {
            long l = 0L;
            if (!bool) {
              if ((localqf.c()) && ((bool) || (localuf.q() != null))) {
                if (!bool)
                {
                  if (localuf.q().getWhen() > l)
                  {
                    l = localuf.q().getWhen();
                    localqf.mousePressed(localuf.q());
                  }
                }
                else
                {
                  if (!bool) {
                    if ((localqf.c()) && ((bool) || (localuf.r() != null)))
                    {
                      if (bool) {
                        break label349;
                      }
                      if (localuf.r().getWhen() > l)
                      {
                        l = localuf.r().getWhen();
                        localqf.mouseDragged(localuf.r());
                      }
                    }
                  }
                  if (localqf.c()) {
                    label349:
                    if ((bool) || (localuf.t() != null)) {
                      if (!bool)
                      {
                        if (localuf.t().getWhen() > l)
                        {
                          l = localuf.t().getWhen();
                          localqf.mouseReleased(localuf.t());
                          if (bool) {
                            return;
                          }
                        }
                      }
                      else if (localqf.c()) {
                        if (((bool) || (localuf.u() != null)) && (localuf.u().getWhen() > l)) {
                          localqf.mouseClicked(localuf.u());
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          finally
          {
            localv.a(true);
          }
        }
      }
    }
  }
  
  private final class c_
    implements ChangeListener
  {
    private c_() {}
    
    public void stateChanged(ChangeEvent paramChangeEvent)
    {
      dd localdd = (dd)paramChangeEvent.getSource();
      if ((ld.E) || (!localdd.b()))
      {
        localdd.b(this);
        v.this.j = null;
      }
    }
    
    c_(v.1 param1)
    {
      this();
    }
  }
  
  public static abstract interface d_
    extends dd
  {
    public abstract void a(pg parampg, v paramv, ld paramld);
    
    public abstract boolean a(double paramDouble1, double paramDouble2);
    
    public abstract Cursor c(ng paramng);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.v

 * JD-Core Version:    0.7.0.1

 */